import request from "@/utils/request";

export function getInvoiceLogList(params) {
  return request({
    url: "/sea/invoiceLog/anonymousList",
    method: "get",
    params,
  });
}

export function cancelOrApply(data) {
  return request({
    url: "/sea/invoiceLog/editAnonymousSub",
    method: "post",
    data,
  });
}
// 发票抬头列表
export function getInvoiceInfoList(params) {
  return request({
    url: "/sea/invoiceInfo/list",
    method: "get",
    params,
  });
}
// 添加抬头
export function addInvoiceInfo(data) {
  return request({
    url: "/sea/invoiceInfo",
    method: "post",
    data,
  });
}
// 修改抬头信息
export function editInvoiceInfo(data) {
  return request({
    url: "/sea/invoiceInfo",
    method: "put",
    data,
  });
}
// 获取抬头详情
export function getInvoiceInfoDetail(id) {
  return request({
    url: `/sea/invoiceInfo/${id}`,
    method: "get",
  });
}

export function deleteInvoiceInfo(id) {
  return request({
    url: `/sea/invoiceInfo/${id}`,
    method: "delete",
  });
}

export function getAllInvoiceList() {
  return request({
    url: `/sea/invoiceInfo/listNoPage`,
    method: "get",
  });
}
// 申请开票
export function applyInvoice(data) {
  return request({
    url: "/sea/invoiceLog/save",
    method: "post",
    data,
  });
}
// 获取开票的详情
export function getInvoiceLogDetail(id) {
  return request({
    url: `/sea/invoiceLog/anonymous/${id}`,
    method: "get",
  });
}
